/*      This file is part of P5ovray.
        
        P5ovray is free software: you can redistribute it and/or modify
        it under the terms of the GNU Lesser General Public License as 
        published by the Free Software Foundation, either version 3 of 
        the License, or (at your option) any later version.
        
        P5ovray is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU Lesser General Public License for more details.
        
        You should have received a copy of the GNU Lesser General Public
        License along with P5ovray.  If not, see <http://www.gnu.org/licenses/>.
*/

package zombie.povray;

import java.io.*;
import processing.core.PApplet;

public class P5ovWriter {
	
	PrintWriter pw;
	PApplet parent;
	
	public P5ovWriter(PApplet _parent)
	{
		parent = _parent;
		pw = parent.createWriter(parent.dataPath("output.pov"));
	}
	
	public P5ovWriter( OutputStream _out, PApplet _parent )
	{
		parent = _parent;
		pw = PApplet.createWriter(_out);
	}
	
	public void flush(){
		pw.flush(); // Writes the remaining data to the file
		pw.close();
	}
	
	public void println( String _string )
	{	
		pw.println(_string);	
	}
}
